#ifndef _HCC_ERROR_CODE_DRV_BRD_H_
#define _HCC_ERROR_CODE_DRV_BRD_H_

#include "ofc_types.h"
#include "hcc_error_code.h"
#include "hcc_error_code_drv.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_DRV_BRD_ERROR(error_code) (int)HCC_MAKE_DRIVER_ERROR(kHccBrd, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_DRV_BRD_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_DRIVER_ERROR(kHccBrd, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * 板级层:板级层
 */
enum Brd_TErrorCodeTag
{
	kBrd_ErrorCodeSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kBrd_ErrorCodeParam	=	HCC_MAKE_DRV_BRD_ERROR(0),			///<参数错误
	kBrd_ErrorCodeComm	=	HCC_MAKE_DRV_BRD_ERROR(1),			///<通讯错误
	kBrd_ErrorCodeCallBack	=	HCC_MAKE_DRV_BRD_ERROR(2),			///<回调函数未设置
	kBrd_ErrorCodeNoExist	=	HCC_MAKE_DRV_BRD_ERROR(3),			///<设备不存在
	kBrd_ErrorCodeNotSupport	=	HCC_MAKE_DRV_BRD_ERROR(4),			///<类型不支持
	kBrd_ErrorCodeOutOfRange	=	HCC_MAKE_DRV_BRD_ERROR(5),			///<超出范围
	kBrd_ErrorCodeOpened	=	HCC_MAKE_DRV_BRD_ERROR(6),			///<设备已打开
	kBrd_ErrorCodeClosed	=	HCC_MAKE_DRV_BRD_ERROR(7),			///<设备已关闭
	kBrd_ErrorCodeBaudRate	=	HCC_MAKE_DRV_BRD_ERROR(8),			///<波特率不合法
	kBrd_ErrorCodeLastUnFinished	=	HCC_MAKE_DRV_BRD_ERROR(9),			///<上一次动作未完成
	kBrd_ErrorCodeFail	=	HCC_MAKE_DRV_BRD_ERROR(10),			///<操作失败
	kBrd_ErrorCodeNotAligned	=	HCC_MAKE_DRV_BRD_ERROR(11),			///<边界未对齐
	kBrd_ErrorCodeTimeout	=	HCC_MAKE_DRV_BRD_ERROR(12),			///<处理超时
	kBrd_ErrorCodeLock                      = HCC_MAKE_DRV_BRD_ERROR(13),   ///< 获取锁失败
    kBrd_ErrorCodePartitonAddr              = HCC_MAKE_DRV_BRD_ERROR(14),   ///< 分区表首地址错误
    kBrd_ErrorCodeCrc                       = HCC_MAKE_DRV_BRD_ERROR(15),   ///< CRC校验错误
    kBrd_ErrorCodeMem                       = HCC_MAKE_DRV_BRD_ERROR(16),   ///< 内存溢出
};
typedef enum Brd_TErrorCodeTag Brd_TErrorCode;


typedef Int32 Brd_TErrorCodeLine;
#define kBrd_ErrorCodeSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kBrd_ErrorCodeParamLine	HCC_MAKE_DRV_BRD_ERROR_LINE(0)	///<参数错误
#define kBrd_ErrorCodeCommLine	HCC_MAKE_DRV_BRD_ERROR_LINE(1)	///<通讯错误
#define kBrd_ErrorCodeCallBackLine	HCC_MAKE_DRV_BRD_ERROR_LINE(2)	///<回调函数未设置
#define kBrd_ErrorCodeNoExistLine	HCC_MAKE_DRV_BRD_ERROR_LINE(3)	///<设备不存在
#define kBrd_ErrorCodeNotSupportLine	HCC_MAKE_DRV_BRD_ERROR_LINE(4)	///<类型不支持
#define kBrd_ErrorCodeOutOfRangeLine	HCC_MAKE_DRV_BRD_ERROR_LINE(5)	///<超出范围
#define kBrd_ErrorCodeOpenedLine	HCC_MAKE_DRV_BRD_ERROR_LINE(6)	///<设备已打开
#define kBrd_ErrorCodeClosedLine	HCC_MAKE_DRV_BRD_ERROR_LINE(7)	///<设备已关闭
#define kBrd_ErrorCodeBaudRateLine	HCC_MAKE_DRV_BRD_ERROR_LINE(8)	///<波特率不合法
#define kBrd_ErrorCodeLastUnFinishedLine	HCC_MAKE_DRV_BRD_ERROR_LINE(9)	///<上一次动作未完成
#define kBrd_ErrorCodeFailLine	HCC_MAKE_DRV_BRD_ERROR_LINE(10)	///<操作失败
#define kBrd_ErrorCodeNotAlignedLine	HCC_MAKE_DRV_BRD_ERROR_LINE(11)	///<边界未对齐
#define kBrd_ErrorCodeTimeoutLine	HCC_MAKE_DRV_BRD_ERROR_LINE(12)	///<处理超时
#define kBrd_ErrorCodeLockLine	HCC_MAKE_DRV_BRD_ERROR_LINE(13)	///<获取锁失败
#define kBrd_ErrorCodePartitonAddrLine	HCC_MAKE_DRV_BRD_ERROR_LINE(14)	///<分区表首地址错误
#define kBrd_ErrorCodeCrcLine	HCC_MAKE_DRV_BRD_ERROR_LINE(15)	///<CRC校验错误
#define kBrd_ErrorCodeMemLine	HCC_MAKE_DRV_BRD_ERROR_LINE(16)	///<内存溢出

#define kBrd_ErrorCodeOffset 100

#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_DRV_BRD_H_
/**
 * @
 */
